<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/14
  Time: 9:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1 align="center">班级管理</h1>
<div align="center">
    <input type="button" value="返回" onclick="goback()">
    <input type="button" value="添加班级" onclick="addClass()">
    <input type="button" value="修改班级" onclick="upClass()">
</div>
<br/>

<div style="width: 300px;height: 150px;margin: 0 auto;display: none;border: 1px solid black;" id="upClass">
    <form action="upClass.claess" method="post">
        <p>选择你要修改的班级</p>
        <select name="oldclass">
            <c:forEach var="tb" items="${classList}" varStatus="vs">
                <option>${tb.classname}</option>
            </c:forEach>
        </select>
        修改为:<input type="text" name="upclassName"><br/>

            <button type="submit">修改</button>


    </form>
</div>

<div style="width: 300px;height: 100px; align:center;margin: 0 auto;display: none;border: 1px solid black;" name="add;"id="addClass">
    <form action="addClass.claess" method="post">
        <p align="center">新增班级：</p>
        班级:<input type="text" name="Classname"><br/>

        <button type="submit">提交</button>

    </form>
</div>

<table border="1" bgcolor="#7fffd4" align="center">
    <tr>

        <th>id</th>
        <th>班级名称</th>
        <th>操作</th>
    </tr>
    <c:forEach var="usl" items="${classList}" varStatus="vs">
        <tr>
            <form action="deletClass.claess" method="post">
                <input type="text" value="${usl.id}" style="display: none" name="ClassId"/>
            <td>${usl.id}</td>
            <td>${usl.classname}</td>
                <td><input type="submit" value="删除"/></td>
            </form>
        </tr>
    </c:forEach>
</table>
</body>
<script>
    function addClass() {
        document.getElementById("addClass").style.display ="block";
    }
function upClass() {
    document.getElementById("upClass").style.display ="block";
}
function goback() {
    window.location.href="ClassOrStudent.jsp";

}
</script>
</html>
